from django.contrib import admin
from .models import UserPan, UserInfo, House, ShiShen, ShiShenAtHouse, ShenSha, Wuxing, Geju, YuanAtMonth, \
    ShiShenCombine, FeedBack
from yi.yi_admin import yi_site


class PanAdmin(admin.ModelAdmin):
    list_display = ['user', 'name', 'gender', 'input', 'created_time', 'last_modified', 'views']
    list_filter = ['gender', 'is_delete']
    list_per_page = 30

yi_site.register(UserPan, PanAdmin)


class UserInfoAdmin(admin.ModelAdmin):
    list_display = ['user', 'nickname', 'created_time']
    list_per_page = 30


yi_site.register(UserInfo, UserInfoAdmin)


class HouseAdmin(admin.ModelAdmin):
    list_display = ['name', 'x', 'y']
    ordering = ['id']

yi_site.register(House, HouseAdmin)


class SSAdmin(admin.ModelAdmin):
    list_display = ['name', 'rule']
    ordering = ['id']

yi_site.register(ShiShen, SSAdmin)


class SSAHAdmin(admin.ModelAdmin):
    list_display = ['name', 'house', 'shishen', 'abbr']
    list_filter = ['house', 'shishen']
    ordering = ['id']
    list_per_page = 20

yi_site.register(ShiShenAtHouse, SSAHAdmin)


class ShenShaAdmin(admin.ModelAdmin):
    list_display = ['name']
    list_per_page = 20

yi_site.register(ShenSha, ShenShaAdmin)


class WXAdmin(admin.ModelAdmin):
    list_display = ['name']

yi_site.register(Wuxing, WXAdmin)


class GejuAdmin(admin.ModelAdmin):
    list_display = ['name', 'category']
    list_filter = ['category']
    list_per_page = 30

yi_site.register(Geju, GejuAdmin)


class YAMAdmin(admin.ModelAdmin):
    list_display = ['name']
    list_per_page = 20
    list_filter = ['gan', 'zhi']

yi_site.register(YuanAtMonth, YAMAdmin)


class SSCAdmin(admin.ModelAdmin):
    list_display = ['name']

yi_site.register(ShiShenCombine, SSCAdmin)


class FeedBackAdmin(admin.ModelAdmin):
    list_display = ['user', 'created_time', 'content']

yi_site.register(FeedBack, FeedBackAdmin)
